package Homework;

import java.io.*;

public class IOHome {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("t1.txt");
        BufferedInputStream bis = new BufferedInputStream(fis);

        FileOutputStream fos = new FileOutputStream("t2.txt");
        BufferedOutputStream bos=new BufferedOutputStream(fos);
        int a;
        long srart = System.currentTimeMillis();
        while ((a=bis.read())!=-1){
            bos.write(a);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完毕！耗时"+(end-srart)+"ms");

        bis.close();
        bos.close();



    }
}
